package com.security.control.models;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import com.security.control.enums.Status;

/**
 * The persistent class for the tbusuario_security database table.
 * 
 */
@Entity
@Table(name = "TBUSUARIO")
public class Usuario extends com.archtecture.control.models.ModelAb implements Serializable {

	/**
	 * 
	 */
	private static final long	serialVersionUID	= 4149954138856783587L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "CD_USUARIO")
	private Integer				codigo;

	@Column(name = "DS_LOGIN")
	private String				login;

	@Column(name = "FL_STATUS")
	private Status				status;

	@Column(name = "HS_SENHA")
	private String				hsSenha;

	@Column(name = "NM_USUARIO")
	private String				nome;

	// bi-directional many-to-many association to Aplicacao
	@ManyToMany(mappedBy = "usuarios")
	private List<Aplicacao>		aplicacaos;

	// bi-directional many-to-many association to Perfil
	@ManyToMany(mappedBy = "usuarios")
	private List<Perfil>		perfis;

	public Usuario() {}

	public List<Aplicacao> getAplicacaos() {
		return aplicacaos;
	}

	@Override
	public String[] getAtributosOrdencao() {
		return new String[] {"codigo"};
	}

	@Override
	public Integer getCodigo() {
		return codigo;
	}

	public String getHsSenha() {
		return hsSenha;
	}

	public String getLogin() {
		return login;
	}

	public String getNome() {
		return nome;
	}

	public List<Perfil> getPerfis() {
		return perfis;
	}

	public Status getStatus() {
		return status;
	}

	public void setAplicacaos(List<Aplicacao> aplicacaos) {
		this.aplicacaos = aplicacaos;
	}

	public void setCodigo(Integer codigo) {
		this.codigo = codigo;
	}

	public void setHsSenha(String hsSenha) {
		this.hsSenha = hsSenha;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public void setPerfis(List<Perfil> perfis) {
		this.perfis = perfis;
	}

	public void setStatus(Status status) {
		this.status = status;
	}

}